package com.bmlstrategys
{
	import com.strategy.IBML;
	import com.utils.Utils;
	
	import flash.utils.ByteArray;
	
	public class CSETInfo extends BMLBase implements IBML
	{
		public function CSETInfo(data:ByteArray)
		{
			super(data);
		}
		
		public function bmlstrategyxml():XML
		{
			//把头读掉
			bmlData.endian = "littleEndian";
			var num:uint = bmlData.readUnsignedInt();
			var index:int=0;
			var xmlData:XML = new XML();
			xmlData = <root/>;
			while(index<num){
				xmlData.appendChild(<equipSets/>);
				xmlData.equipSets[index].@setId = bmlData.readUnsignedInt();
				xmlData.equipSets[index].@setName = Utils.readString(bmlData);
				var collectNum:uint = bmlData.readUnsignedInt();
				xmlData.equipSets[index].@collectnum = collectNum;
				var j:uint=1;
				while(j<=collectNum)
				{
					xmlData.equipSets[index].@["collectInfoList"+j] = [bmlData.readUnsignedInt(),bmlData.readUnsignedInt(),bmlData.readUnsignedInt()];
					j++;	
				}
				
				index++;
			}
			return xmlData;
		}
	}
}